// 命名path全部小写，命名name首字母大写并驼峰
// eg: path:hometest  name:HomeTest
// eg: path:a/test name:ATest
import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/layout/Layout'
import { error } from './error'

import { account } from './account'
import { home } from './home'
import { prediction } from './prediction'
import { trumpet } from './trumpet'
Vue.use(Router)
const base = process.env.VUE_APP_PUBLIC_PATH
export const routerMap = [
  {
    path: '',
    component: Layout,
    redirect: '/account'
  },
  { path: '*', redirect: '/error/404' }
]
export const constantRouterMap = [account, home, prediction, trumpet, error]
export default new Router({
  mode: 'hash', // require service support
  base,
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
})
